package com.itheima.stock.config;

import com.itheima.stock.cache.Cache;
import com.itheima.stock.cache.Impl.RedisCache;
import com.itheima.stock.properties.IdWorkProperties;
import com.itheima.stock.util.IdWorkers;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

/**
 * @author zby
 * @created 2024-06-24 23:03
 * @description
 */
@Configuration
@Component
public class IdWorkersConfiguration {
@Bean
    public IdWorkers idWorkers(IdWorkProperties properties){
        return new IdWorkers(properties.getMachineId(),properties.getDatacenterId());
    }

}